<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>

    var obj = {
        name: 'sss',
        sex: '公',
        sayHi: function () {

        }
    }

    function Dog(name, age) {
        this.name = name;
        this.age = age;
    }


    Dog.prototype = {
        constructor: Dog,
        eat: function () {
            console.log(this.name + '吃狗粮');
        },
        sayHi: function () {
            console.log(this.name + '：旺旺旺~~~');

        }
    }

    var dog = new Dog('阿拉撕家', 2);
    dog.eat();
    dog.sayHi();


</script>q

</html>